<!DOCTYPE html>
<html >
<head>
	<meta charset="UTF-8">
	<title>blog</title>
	<?php include("header.php");?>
</head>
<body>
	<?php include("nav.php");?>
	<div class="container">
		<div class="page-header">
			<h1>分类<small>列表</small>
				<a href="<?php echo site_url("admin/nav/add");?>"><button type="button" class="btn btn-success pull-right">添加</button></a>
			</h1>
		</div>	
		<table class="table table-bordered" >
			<tr>
				<th class="col-md-4">id</th>
				<th class="col-md-4">名称</th>
				<th class="col-md-4">操作</th>	
			</tr>
			<tr>
				<?php 
					if(empty($navs)){
				?>
				<td class="errors" colspan="9">	
					没有数据
				</td>
				<?php
					}
				?>
			</tr>
			<tr>
			<?php 
				foreach ($navs as $nav) {
			?>
				<td><a class="id" href="../view.php?id=<?php echo $nav->id;?>"><?php echo $nav->id;?></a></td>
				<td><?php echo $nav->name; ?></td>
				<td>
					<a href="<?php echo site_url("admin/nav/edit/".$nav->id);?>"><button type="button" class="btn btn-warning btn-sm">修改</button></a>
					<a class="del" href="<?php echo site_url("admin/nav/del/".$nav->id);?>"><button type="button" class="btn btn-danger btn-sm">删除</button></a>
				</td>
			</tr>
			<?php
				}
			?>

		</table>
	</div>
</body>
</html>